home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / MCASM.RAR / MC_ASM.EXE / WROX_ASM / CH12 / COMMON / CONFIGS.CPP < prev    next >
C/C++ Source or Header  |  1994-06-21  |  435b  |  25 lines

  1. #include <string.h>
  2. #include <stdio.h>
  3. #include "common.h"
  4.  
  5. char *next_string(FILE *f){
  6.     static char s[120];
  7.     char *s1;
  8.     int i;
  9.  
  10.     do {
  11.         if feof(f) return("");
  12.         fgets(s, 120, f);
  13.     }
  14.     while(s[0] == ';'); //skip comment strings
  15.  
  16.     s1 = strchr(s,';');
  17.     if (s1 == NULL) i = strlen(s) -1;
  18.     else i = s1-s;
  19.      //kill comment and spaces
  20.     while (((s[i]==' ') || (s[i]=='\t')) && (i-- > 0))  s[i] = '\x0';
  21.     return(s);
  22. }
  23.  
  24.  
  25.